import request from '@/utils/request'
import axios from 'axios'
import SettingMer from '@/utils/settingMer'

const api = {
  version:{
    v1:"/rest/vabc",
    m1:"/rest/m1",
    c1:"/rest/c1",
  },
  url: {
    uploadFile: SettingMer.apiBaseURL+'sys/common/uploadImg', //上传图片
    uploadErpGoodsInfoExcel: SettingMer.apiBaseURL+'sys/common/uploadErpGoodsInfoExcel', //上传图片
  },
  getLikeValue(value){
    return value.length==0?value:'*'+value+'*';
  },
  getLikeValue2(value){
    return value.length==0?value:'%'+value+'%';
  },
  post(url, data) {
    return request({
      url: url,
      method: 'POST',
      data: data
    })
  },
  action(url,data, params) {
    return request({
      url: url,
      method: 'POST',
      params,
      data
    })
  },
  actionOfget(url, params) {
    return request({
      url: url,
      method: 'get',
      params
    })
  },
  get(url, params) {
    return request({
      url: url,
      method: 'get',
      params
    })
  }
}
export default api
